var e = getApp();

Page({
    data: {
        shopName: "",
        storeName: "",
        number: "",
        money: "",
        dispatch_type_id: 2,
        goods_id: 408,
        store_id: 9,
        wait_adverts: []
    },
    onLoad: function(e) {
        var o = wx.getStorageSync("storeMessage");
        o.store_name && this.setData({
            storeName: o.store_name,
            shopName: o.shop_name
        }), this.getData();
    },
    getData: function() {
        var o = this, t = "";
        wx.showLoading({
            title: "加载中"
        });
        try {
            var n = wx.getStorageSync("wx_token");
            n && (t = n);
        } catch (e) {
            console.log(e);
        }
        wx.request({
            url: e.getFrogproNetAddresss("plugin.store-cashier.frontend.app.cashier.statistic.index"),
            header: {
                "Content-Type": "application/json",
                Accept: "application/json",
                Cookie: "PHPSESSID=" + t
            },
            method: "get",
            success: function(e) {
                var t = e.data;
                1 == t.result ? o.setData({
                    money: t.data.today.amount,
                    number: t.data.today.count
                }) : console.error(t, "result != 1"), wx.hideLoading();
            },
            fail: function(e) {
                console.error(e, "请求错误");
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {
        wxfaceapp.postMsg({
            targetAppid: e.data.accept_message_id,
            content: JSON.stringify({
                bolshow: !1,
                moneyBol: !0
            }),
            success: function(e) {},
            fail: function(e) {}
        });
    },
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    gatheringBtn: function() {
        wx.navigateTo({
            url: "/packageC/frogpro/cashier_desk/cashier_desk"
        });
    },
    quitLogin: function() {
        wx.redirectTo({
            url: "/packageC/frogpro/backScreenlogin/backScreenlogin"
        });
    }
});